//
//  UIDevice+DeviceType.m
//  1243
//
//  Created by 我的 on 16/4/16.
//  Copyright © 2016年 1243. All rights reserved.
//

#import "UIDevice+DeviceType.h"
#include "sys/types.h"
#include "sys/sysctl.h"

@implementation UIDevice(DeviceType)
- (NSString*)machine
{
    size_t size;
    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
    char* name = (char*)malloc(size);
    sysctlbyname("hw.machine", name, &size, NULL, 0);
    NSString* machine = [NSString stringWithCString:name encoding:NSUTF8StringEncoding];
    free(name);
    
    return machine;
}


@end
